]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
credentialManager: Shut up a JS warning
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 28 Oct 2020 19:26:18 +0000 (20:26 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 26 Nov 2020 13:17:26 +0000 (14:17 +0100)
Plain classes are private to their file, so accessing them from
another module results in the following warning:

    That property was defined with 'let' or 'const' inside the module.
    This was previously supported, but is not correct according to the
    ES6 standard.

Fix by assigning the class to a public variable instead.

(Eventually switching to ES6 modules with proper imports/exports will
fix this as well)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1512>

js/gdm/credentialManager.js

index cf001f4e42575695012a1c2704ea00e3abdbe0a1..5c4bc7e62a35fdc5b89e2b03149b7c8da314068c 100644 (file)
@@ -1,7 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 /* exported CredentialManager */
 
-class CredentialManager {
+var CredentialManager = class CredentialManager {
     constructor(service) {
         this._token = null;
         this._service = service;
@@ -21,4 +21,4 @@ class CredentialManager {
     get service() {
         return this._service;
     }
-}
+};